package com.stephen.redisdemo;

/**
 * @author: stephen
 * @create: 2020-02-27 09:50
 * @description:
 */
public class SingletonDemo {

    private volatile static SingletonDemo instance;

    private SingletonDemo() {

    }

    public static SingletonDemo getInstance() {
        if (instance == null) {
            synchronized (SingletonDemo.class) {
                if (instance == null) {
                    instance = new SingletonDemo();
                }
            }
        }
        return instance;
    }

}
